import request from '@/utils/request'

// 查询商品列表
export function listProduct(query) {
  return request({
    url: '/system/product/list',
    method: 'get',
    params: query
  })
}

// 查询商品详细
export function getProduct(productId) {
  return request({
    url: '/system/product/' + productId,
    method: 'get'
  })
}

// 新增商品
export function addProduct(data) {
  return request({
    url: '/system/product',
    method: 'post',
    data: data
  })
}

// 修改商品
export function updateProduct(data) {
  return request({
    url: '/system/product',
    method: 'put',
    data: data
  })
}

// 删除商品
export function delProduct(productId,storeId) {
  return request({
    url: '/system/product/' + productId + '/' + storeId,
    method: 'delete'
  })
}

//查询字典
export function listDictionaries(){
  return request({
    url:'/system/product/diction',
    method:'get',
  })
}

//新增库存
export function addProductInventory(data){
  return request({
    url:'/system/product/inventory',
    method:'post',
    data:data
  })
}